]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspacesView: Refactor thumb zooming out code
authorJasper St. Pierre <jstpierre@mecheye.net>
Wed, 8 Aug 2012 20:21:19 +0000 (17:21 -0300)
committerJasper St. Pierre <jstpierre@mecheye.net>
Fri, 24 Aug 2012 02:36:25 +0000 (23:36 -0300)
https://bugzilla.gnome.org/show_bug.cgi?id=582650

js/ui/workspacesView.js

index 2b5eac5bcf677ee65de917f15c6768ca668dab8e..b8204f04f077ccf2188f117470a275d39c246bee 100644 (file)
@@ -868,15 +868,10 @@ const WorkspacesDisplay = new Lang.Class({
         let clipX = rtl ? x + controlsVisible : x;
         let clipY = y + (fullHeight - clipHeight) / 2;
 
-        if (this._zoomOut) {
-            width -= controlsNatural;
-            if (rtl)
-                x += controlsNatural;
-        } else {
-            width -= controlsVisible;
-            if (rtl)
-                x += controlsVisible;
-        }
+        let widthAdjust = this._zoomOut ? controlsNatural : controlsVisible;
+        width -= widthAdjust;
+        if (rtl)
+            x += widthAdjust;
 
         height = (fullHeight / fullWidth) * width;
         let difference = fullHeight - height;